package kr.hkit.powerjava.chapter24.sd.vo;

import java.io.Serializable;

public class Department implements Serializable, Comparable<Department> {
		private int dptNo;
		private String dptName;
		private int floor;
		
		public Department(int dptNo, String dptName, int floor) {
			this.dptNo = dptNo;
			this.dptName = dptName;
			this.floor = floor;
		}
		public Department(int dptNo, String dptName) {
			super();
			this.dptNo = dptNo;
			this.dptName = dptName;
		}
		public int getDptNo() {
			return dptNo;
		}
		public void setDptNo(int dptNo) {
			this.dptNo = dptNo;
		}
		public String getDptName() {
			return dptName;
		}
		public void setDptName(String dptName) {
			this.dptName = dptName;
		}
		public int getFloor() {
			return floor;
		}
		public void setFloor(int floor) {
			this.floor = floor;
		}
		
		
		@Override
		public String toString() {
			return String.format("Department [dptNo=%s, dptName=%s, floor=%s]",
					dptNo, dptName, floor);
		}
		
		@Override
		public boolean equals(Object obj) {
			if (obj instanceof Department) {
				Department temp = (Department)obj;
				return dptNo == temp.dptNo && dptName.equals(temp.dptName); 
			} else {
				return false;
			}
		}
		
		@Override
		public int compareTo(Department o) {
			return dptNo - o.dptNo;
		}
		
}
